package com.longcai.controller.fuyoupay;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.longcai.bean.ApiResult;
import com.longcai.entity.nearby.ClyjNearbyShops;
import com.longcai.entity.payment.fuyou.request.ClyjFuyouSmallcompanyRegister;
import com.longcai.service.fuyoupay.ClyjFuyouSmallcompanyRegisterService;

/**
 * <p>
 * 富友支付小微企业注册表 前端控制器
 * </p>
 *
 * @author ZJ
 * @since 2019-03-31
 */
@Controller
@RequestMapping("/clyjFuyouSmallcompanyRegister")
public class ClyjFuyouSmallcompanyRegisterController {
	@Autowired  
	ClyjFuyouSmallcompanyRegisterService clyjFuyouSmallcompanyRegisterService;
	@RequestMapping("/cfcruestSave")
	@ResponseBody
	public ApiResult<?> AddSmallCompanyRegister (ClyjNearbyShops clyjNearbyShops){
		ApiResult<ClyjFuyouSmallcompanyRegister> cfcr=clyjFuyouSmallcompanyRegisterService.checkout(clyjNearbyShops);
		
		if (cfcr.getData() instanceof ClyjFuyouSmallcompanyRegister) {
			boolean b=clyjFuyouSmallcompanyRegisterService.insert(cfcr.getData());
			if(b){
				return ApiResult.success("注册成功");
			}
		}
		return ApiResult.fail(cfcr.getData());
	}

}

